public class Practice1 {
    //很简单的一题指针
    //https://www.nowcoder.com/practice/f094aed769d84cf3b799033c82fc1bf6?tpId=182&tqId=34710&ru=/exam/oj
    public String formatString(String A, int n, char[] arg, int m) {
        // write code here
        StringBuilder sb = new StringBuilder();
        int cur = 0;
        for(int i = 0;i < n;i++){
            char s = A.charAt(i);
            if(s == '%'){
                i++;
                sb.append(arg[cur++]);
            }else{
                sb.append(s);
            }

        }
        while(cur != m){
            sb.append(arg[cur++]);
        }
        return sb.toString();
    }
    public static void main(String[] args) {

    }
}
